<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const a = {
      a: {
        d: 123
      },
      a1:123
    }
    const b = {
      // a:234,
      c:'c'
    }
    //只是浅拷贝
    const d = Object.assign({},a,b)
    console.log(d);
    //会修改a的值
    d.a.d = 'a'
    d.a1 = 'a1'
    console.log(a);
    console.log(d);
    
  </script>
</body>
</html>